﻿﻿
<html lang="zh">
<head>

    <title>${title!'数据库设计文档'}</title>
    <style type='text/css'>


        body {
            padding-bottom: 50px
        }

        body, td {
            font-family: verdana, fantasy;
            font-size: 12px;
            line-height: 150%
        }

        table {
            width: 100%;
            background-color: #ccc;
            margin: 5px 0
        }

        td {
            background-color: #fff;
            padding: 3px 3px 3px 10px
        }

        thead td {
            text-align: center;
            font-weight: bold;
            background-color: #eee
        }

        a:link, a:visited, a:active {
            color: #015fb6;
            text-decoration: none
        }

        a:hover {
            color: #e33e06
        }
    </style>
</head>

<body style='text-align:center;'>
<div style='width:800px; margin:20px auto; text-align:left;'>
    <a name='index'></a>
    <h2 style='text-align:center; line-height:50px;'>${title!'数据库设计文档'}</h2>
    <div>
        <#--<b>数据库名：${database!''}</b><br>-->
        <#if (version)??><b>文档版本：${version!''}</b><br>
        </#if>
        <#if (describe)??>
            <b>文档描述：${describe!''}</b>
            <br>
        </#if>
    </div>
    <table cellspacing='1'>
        <thead>
        <tr>
            <td style='width:40px; '>序号</td>
            <td>表名</td>
            <td>说明</td>
        </tr>
        </thead>

        <#if tableModelList?? && (tableModelList?size > 0) >
            <#list tableModelList>
                <#items as t>
                    <tr>
                        <td style='text-align:center;'>${t?index+1}</td>
                        <td><a href='#${t.tableName}'>${t.tableName}</a></td>
                        <td>${t.remarks!''}</td>
                    </tr>
                </#items>
            </#list>
        </#if>

    </table>

    <#if tableModelList?? && (tableModelList?size > 0) >
        <#list tableModelList>
            <#items as t>
                <a name='${t.tableName}'></a>
                <div style='margin-top:30px;'>
                    <a href='#index' style='float:right; margin-top:6px;'>返回目录</a><b>表名：${t.tableName}</b>
                </div>
                <div>说明：${t.remarks!''}</div>
                <div>数据列：</div>
                <table cellspacing='1'>
                    <thead>
                    <tr>
                        <td style='width:40px; '>序号</td>
                        <td>名称</td>
                        <td>数据类型</td>
                        <td>小数位</td>
                        <td>允许空值</td>
                        <td>主键</td>
                        <td>默认值</td>
                        <td>说明</td>
                    </tr>
                    </thead>

                    <#list t.columnModelList>
                        <#items as c>
                            <tr>
                                <td style='text-align:center;'>${c?index+1}</td>
                                <td>${c.columnName!''}</td>
                                <td align='center'>${c.type!''}</td>
                                <td align='center'>${c.decimalDigits!'0'}</td>
                                <td align='center'>
                                    <#if (c.nullable?string('true', 'false') == 'true')>
                                        允许
                                    <#else>
                                        不允许
                                    </#if>
                                </td>
                                <td align='center'>
                                    <#if (c.pk?string('true', 'false') == 'true')>
                                        true
                                    <#else>

                                    </#if>
                                </td>
                                <td align='center'>${c.defaultValue!''}</td>
                                <td align='center'>${c.remarks!''}</td>
                            </tr>
                        </#items>
                    </#list>
                </table>
            </#items>

        </#list>
    </#if>

</div>


<footer>
    <#--机构信息-->
    <#if (organization)??>
        <div><a href="${organizationUrl!'#'}">${organization!''}</a></div>
    </#if>
</footer>
</body>
</html>
